package com.idudiao.sc.stream.stream;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.messaging.handler.annotation.SendTo;

/**
 * @author: 读钓
 * @date 2018-11-30 23:21
 */
@EnableBinding({TestCallBack.class, TestSender.class})
@Slf4j
public class ConsumerReceiver {

    @StreamListener(TestSender.INPUT)
    @SendTo(TestCallBack.OUTPUT)
    public Object process(String message, @Header(name = "batchNo") String batchNo) {
        log.info("【sc-consumer】ConsumerReceiver [batchNo]={}, 接收到消息: {}", batchNo, message);
        return message + " -- sc-consumer小尾巴。";
    }

}